home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
prgtools
/
gnustuff
/
tos
/
gawk
/
gawk213b.zoo
/
test
/
sortdir1.awk
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
AWK Script
|
1991-04-06
|
395 b
|
20 lines
#
# A demo of using your own temporary files with gawk
# Use as in 'gawk -f sortdir1.awk > outs'
#
# !!! WILL CREATE (OR OVERWRITE) FILE ls.tmp -- WATCH OUT !!!
#
BEGIN {
cmd1 = "ls -l"
cmd2 = "sort -n +3"
tmpfile = "ls.tmp"
while ((cmd1 | getline) > 0)
print $0 > tmpfile
close (cmd1)
close (tmpfile)
while ((getline < tmpfile) > 0)
print $0 | cmd2
close (cmd2)
close (tmpfile)
}